import { reactive, ref } from 'vue'
import { DriverModel } from '@/api/driver/driverModel'
export default function useBaseDriver() {
  const depts = [
    {
      value: '',
      label: '请选择'
    },
    {
      value: '1',
      label: '土壤传感器'
    },
    {
      value: '2',
      label: '环境传感器'
    },
    {
      value: '3',
      label: '气象站传感器'
    },
    {
      value: '4',
      label: '电磁阀'
    },
    {
      value: '5',
      label: '风机'
    },
    {
      value: '6',
      label: '加热器'
    },
    {
      value: '7',
      label: '卷帘'
    }
  ]

  const deptsChild = [
    {
      value: '1',
      label: '土壤传感器1'
    },
    {
      value: '2',
      label: '土壤传感器2'
    },
    {
      value: '3',
      label: '土壤传感器3'
    }
  ]

  const devices = [
    {
      value: '',
      label: '请选择'
    },
    {
      value: '1',
      label: '监测类'
    },
    {
      value: '2',
      label: '可控类'
    }
  ]

  const jidi = [
    {
      value: '',
      label: '请选择'
    },
    {
      value: '1',
      label: 'tzh的基地'
    },
    {
      value: '2',
      label: 'tzh的基地2'
    }
  ]

  const fenqu = [
    {
      value: '',
      label: '请选择'
    },
    {
      value: '1',
      label: '东区'
    },
    {
      value: '2',
      label: '西区'
    }
  ]

  const dapeng = [
    {
      value: '',
      label: '请选择'
    },
    {
      value: '1',
      label: '大棚1'
    },
    {
      value: '2',
      label: '大棚2'
    }
  ]

  const tableColumns = [
    {
      prop: 'a',
      label: '基地名称'
    },

    {
      prop: 'b',
      label: '分区名称'
    },
    {
      prop: 'c',
      label: '大棚名称'
    },

    {
      prop: 'd',
      label: '设备名称'
    },

    {
      prop: 'e',
      label: '设备类型'
    },

    {
      prop: 'f',
      label: '备注'
    },
    {
      prop: 'g',
      label: '添加时间'
    }
  ]

  const tableColumns2 = [
    {
      prop: 'a',
      label: '设备'
    },

    {
      prop: 'b',
      label: '设备名称'
    },
    {
      prop: 'bb',
      label: '设备编号'
    },
    {
      prop: 'bbb',
      label: '设备类型'
    },

    {
      prop: 'd',
      label: '添加时间'
    },

    {
      prop: 'e',
      label: '备注'
    }
  ]

  const tableColumns3 = [
    {
      prop: 'a',
      label: '设备类型'
    },

    {
      prop: 'b',
      label: '设备名称'
    },
    {
      prop: 'bb',
      label: '设备编号'
    },
    {
      prop: 'c',
      label: '所在区域'
    },

    {
      prop: 'd',
      label: '控制类型'
    },
    {
      prop: 'e',
      label: '开始时间'
    },
    {
      prop: 'f',
      label: '结束时间'
    },
    {
      prop: 'g',
      label: '时长'
    }
  ]

  const tableColumns4 = [
    {
      prop: 'a',
      label: '监控名称'
    },

    {
      prop: 'b',
      label: '所在区域'
    },
    {
      prop: 'c',
      label: '监控编号'
    },
    {
      prop: 'd',
      label: '添加时间'
    },
    {
      prop: 'e',
      label: '备注'
    }
  ]

  const tableColumns5 = [
    {
      prop: 'a',
      label: '大棚名称'
    },

    {
      prop: 'b',
      label: '所在区域'
    },
    {
      prop: 'c',
      label: '地块面积'
    },
    {
      prop: 'd',
      label: '添加时间'
    }
  ]

  const driverModel = reactive<DriverModel>({
    deptId: '',
    content: '',
    pageIndex: 1,
    pageSize: 20
  })

  const sensorModel = reactive({
    sensorId: '',
    jidiId: '',
    fenquId: '',
    dapengId: '',
    marker: ''
  })

  const dialogVisible = ref(false)
  const openDialogVisible = ref(false)
  const dialogTitle = ref('传感器')

  return {
    depts,
    devices,
    deptsChild,
    tableColumns,
    tableColumns2,
    tableColumns3,
    tableColumns4,
    tableColumns5,
    driverModel,
    dialogVisible,
    dialogTitle,
    sensorModel,
    openDialogVisible,
    dapeng,
    jidi,
    fenqu
  }
}
